<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                template="/templates/templateLogin.xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://xmlns.jcp.org/jsf/core">
    <ui:define name="head">
        <title>Login</title>
    </ui:define>
    <ui:define name="body">
        <h:form>
            <div align="left">
                <p:commandButton id="btnChangeLanguage" value="Cambiar" action="#{loginController.cambiarLenguaje()}" ajax="false" />
            </div>
        </h:form>
        <h:form id="formLogin">
            <div align="left">
                <p:commandButton id="btnChangeLanguage" value="Cambiar" action="#{loginController.cambiarLenguaje()}" process="@this" update="formLogin"/>
            </div>

            <p:messages autoUpdate="true" showDetail="true"/>
            <p:panelGrid id="panel" columns="2">
                <f:facet name="header">
                    #{msg['login.title']}
                </f:facet>

                <p:outputLabel id="lblUsuario" value="#{msg['login.username']}"/>
                <p:inputText id="txtUsuario" required="true" value="#{loginController.usuario}"/>
                <p:outputLabel id="lblContraseña" value="#{msg['login.password']}"/>
                <p:password id="txtContraseña" required="true" value="#{loginController.password}"/>

                <f:facet name="footer">

                    <div align="center">
                        <p:commandButton id="btnLogin" value="Login" action="#{loginController.login()}"/>
                    </div>

                </f:facet>
            </p:panelGrid>
        </h:form>
    </ui:define>
</ui:composition>

